#!/usr/bin/env python
# -*- coding: utf-8 -*-

from modules.install import *
from modules.files import *
from modules.mythread import *
import time


class main():

    filename = './ip'
    ipList = File().read(filename)
    cm_host='172.18.0.7'
    Clustername="cluster"
    Servicetype='hdfs'
    dnlists = []
    for dn in ipList:
        dn = dn.strip()
        print "%s\t start install !" % (dn)
        dnlists.append(InStall(cm_host,Clustername,Servicetype,dn).addcluster())
    time.sleep(350)
    for i in dnlists:
        InStall(cm_host,Clustername,Servicetype,dn).group(i)

if __name__ == "__main__":
    main()
